package com.application.lucky.bean.sqliteBean;

import android.os.Parcel;
import android.os.Parcelable;

import com.qunar.im.base.module.RecentConversation;

import org.greenrobot.greendao.annotation.Entity;
import org.greenrobot.greendao.annotation.Generated;
import org.greenrobot.greendao.annotation.Id;

@Entity
public class LateContactBean implements Parcelable {
    @Id(autoincrement = true)
    public Long _id;
    public String id;
    public String name;
    public String userId;
    public int conversationType;
    public String lastFrom;
    public long lastMsgTime;
    public String msgType;
    public String lastMsg;
    public int remind;
    public int unread_msg_cont;
    public String realUser;
    public String lastState;

    @Generated(hash = 38140480)
    public LateContactBean(Long _id, String id, String name, String userId, int conversationType,
            String lastFrom, long lastMsgTime, String msgType, String lastMsg, int remind,
            int unread_msg_cont, String realUser, String lastState) {
        this._id = _id;
        this.id = id;
        this.name = name;
        this.userId = userId;
        this.conversationType = conversationType;
        this.lastFrom = lastFrom;
        this.lastMsgTime = lastMsgTime;
        this.msgType = msgType;
        this.lastMsg = lastMsg;
        this.remind = remind;
        this.unread_msg_cont = unread_msg_cont;
        this.realUser = realUser;
        this.lastState = lastState;
    }

    @Generated(hash = 1848783280)
    public LateContactBean() {
    }

    public Long get_id() {
        return _id;
    }

    public void set_id(Long _id) {
        this._id = _id;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getUserId() {
        return userId;
    }

    public void setUserId(String userId) {
        this.userId = userId;
    }

    public int getConversationType() {
        return conversationType;
    }

    public void setConversationType(int conversationType) {
        this.conversationType = conversationType;
    }

    public String getLastFrom() {
        return lastFrom;
    }

    public void setLastFrom(String lastFrom) {
        this.lastFrom = lastFrom;
    }

    public long getLastMsgTime() {
        return lastMsgTime;
    }

    public void setLastMsgTime(long lastMsgTime) {
        this.lastMsgTime = lastMsgTime;
    }

    public String getMsgType() {
        return msgType;
    }

    public void setMsgType(String msgType) {
        this.msgType = msgType;
    }

    public String getLastMsg() {
        return lastMsg;
    }

    public void setLastMsg(String lastMsg) {
        this.lastMsg = lastMsg;
    }

    public int getRemind() {
        return remind;
    }

    public void setRemind(int remind) {
        this.remind = remind;
    }

    public int getUnread_msg_cont() {
        return unread_msg_cont;
    }

    public void setUnread_msg_cont(int unread_msg_cont) {
        this.unread_msg_cont = unread_msg_cont;
    }

    public String getRealUser() {
        return realUser;
    }

    public void setRealUser(String realUser) {
        this.realUser = realUser;
    }

    public String getLastState() {
        return lastState;
    }

    public void setLastState(String lastState) {
        this.lastState = lastState;
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeLong(this._id);
        dest.writeString(this.id);
        dest.writeString(this.name);
        dest.writeString(this.userId);
        dest.writeInt(this.conversationType);
        dest.writeString(this.lastFrom);
        dest.writeLong(this.lastMsgTime);
        dest.writeString(this.msgType);
        dest.writeString(this.lastMsg);
        dest.writeInt(this.remind);
        dest.writeInt(this.unread_msg_cont);
        dest.writeString(this.realUser);
        dest.writeString(this.lastState);
    }

    protected LateContactBean(Parcel in) {
        this._id = (Long) in.readValue(Long.class.getClassLoader());
        this.id = in.readString();
        this.name = in.readString();
        this.userId = in.readString();
        this.conversationType = in.readInt();
        this.lastFrom = in.readString();
        this.lastMsgTime = in.readLong();
        this.msgType = in.readString();
        this.lastMsg = in.readString();
        this.remind = in.readInt();
        this.unread_msg_cont = in.readInt();
        this.realUser = in.readString();
        this.lastState = in.readString();
    }

    public static final Creator<LateContactBean> CREATOR = new Creator<LateContactBean>() {
        @Override
        public LateContactBean createFromParcel(Parcel source) {
            return new LateContactBean(source);
        }

        @Override
        public LateContactBean[] newArray(int size) {
            return new LateContactBean[size];
        }
    };

    public void copyToRecentConversation(RecentConversation recentConversation) {
        recentConversation.setId(getId());
        recentConversation.setRealUser(getRealUser());
        recentConversation.setUnread_msg_cont(getUnread_msg_cont());
        recentConversation.setConversationType(getConversationType());
        recentConversation.setRemind(getRemind());
        recentConversation.setLastFrom(getLastFrom());
        recentConversation.setMsgType(Integer.parseInt(getMsgType()));
        recentConversation.setLastMsgTime(getLastMsgTime());
        recentConversation.setLastMsg(getLastMsg());
        recentConversation.setLastState(getLastState());
    }
}
